package unit3;

public class GoodDog {
    private int size;

    public void setSize(int s) {
        if (s <= 0) {
            throw new IllegalArgumentException("Size must be greater than zero");
//            size = 5;
//            System.out.println("Size cannot be negative. Setting size to 5.");
        } else {
            size = s;
        }
    }

    public int getSize() {
        return size;
    }

    void bark() {
        if (size > 60) {
            System.out.println("Woof! Woof!");
        } else if (size > 14) {
            System.out.println("Ruff! Ruff!");
        } else if (size > 0) {
            System.out.println("Yip! Yip!");
        } else {
            System.out.println("Error in dog size");
        }
    }
}
